#!/usr/bin/env python

PACKAGE='astra_camera'

from dynamic_reconfigure.parameter_generator_catkin import *

gen = ParameterGenerator()

# TODO Only offer modes supported by known hardware
output_mode_enum = gen.enum([  gen.const(  "SXGA_30Hz", int_t, 1,  "1280x1024@30Hz"),
                               gen.const(  "SXGA_15Hz", int_t, 2,  "1280x1024@15Hz"),
                               gen.const(  "1280800_30Hz", int_t, 3,  "1280x800@30Hz"),
                               gen.const(  "1280800_15Hz", int_t, 4,  "1280x800@15Hz"),
                               gen.const(   "XGA_30Hz", int_t, 5,  "1280x720@30Hz"),
                               gen.const(   "XGA_15Hz", int_t, 6,  "1280x720@15Hz"),
                               gen.const(   "VGA_30Hz", int_t, 7,  "640x480@30Hz"),
                               gen.const(   "VGA_15Hz", int_t, 8,  "640x480@15Hz"),
                               gen.const(   "VGA_60Hz", int_t, 9,  "640x480@60Hz"),
                               gen.const(  "QVGA_30Hz", int_t, 10,  "320x240@30Hz"),
                               gen.const(  "QVGA_15Hz", int_t, 11,  "320x240@15Hz"),
                               gen.const(  "QVGA_60Hz", int_t, 12,  "320x240@60Hz"),
                               gen.const( "QQVGA_30Hz", int_t, 13, "160x120@30Hz"),
                               gen.const( "QQVGA_15Hz", int_t, 14, "160x120@15Hz"),                              
                               gen.const( "QQVGA_60Hz", int_t, 15, "160x120@60Hz"),
                               gen.const("640400_30Hz", int_t, 16, "640x400@30Hz"),
                               gen.const("640400_15Hz", int_t, 17, "640x400@15Hz"),
                               gen.const("640400_10Hz", int_t, 18, "640x400@10Hz"),
                               gen.const("640400_5Hz", int_t, 19, "640x400@5Hz"),
                               gen.const("640400_60Hz", int_t, 20, "640x400@60Hz"),
                               gen.const("320200_30Hz", int_t, 21, "320x200@30Hz"),
                               gen.const("320200_15Hz", int_t, 22, "320x200@15Hz"),
                               gen.const("320200_10Hz", int_t, 23, "320x200@10Hz"),
                               gen.const("320200_5Hz", int_t, 24, "320x200@5Hz"),
                               gen.const("12801024_7Hz", int_t, 25, "1280x1024@7Hz"),
                               gen.const("1280800_7Hz", int_t, 26, "1280x800@7Hz"),
                               gen.const("320200_60Hz", int_t, 27, "320x200@60Hz"),
                               gen.const("320240_60Hz", int_t, 28, "320x240@60Hz")],
                               "output mode")

video_stream_enum = gen.enum([  gen.const(  "RGB", bool_t, True,  "RGB video stream preferred"),
                                gen.const(  "IR", bool_t, False,  "IR video stream preferred")],
                                "preferred video stream mode")

gen.add("rgb_preferred", bool_t, 0, "Preferred camera stream", True, edit_method = video_stream_enum)

gen.add("ir_mode", int_t, 0, "Video mode for IR camera", 7, 1, 28, edit_method = output_mode_enum)
gen.add("color_mode", int_t, 0, "Video mode for color camera", 7, 1, 28, edit_method = output_mode_enum)
gen.add("depth_mode", int_t, 0, "Video mode for depth camera", 7, 1, 28, edit_method = output_mode_enum)

gen.add("depth_registration", bool_t, 0, "Depth data registration", True)
gen.add("color_depth_synchronization", bool_t, 0, "Synchronization of color and depth camera", False)
gen.add("auto_exposure", bool_t, 0, "Auto-Exposure", True)
gen.add("auto_white_balance", bool_t, 0, "Auto-White-Balance", True)

gen.add("data_skip",  int_t, 0, "Skip N images for every image published (rgb/depth/depth_registered/ir)", 0, 0, 10)

gen.add("ir_time_offset", double_t, 0, "ir image time offset in seconds", -0.033, -1.0, 1.0 );
gen.add("color_time_offset", double_t, 0, "color image time offset in seconds", -0.033, -1.0, 1.0 );
gen.add("depth_time_offset", double_t, 0, "depth image time offset in seconds", -0.033, -1.0, 1.0 );

gen.add("depth_ir_offset_x", double_t, 0, "X offset between IR and depth images", 5.0, -20.0, 20.0)
gen.add("depth_ir_offset_y", double_t, 0, "Y offset between IR and depth images", 4.0, -20.0, 20.0)

gen.add("z_offset_mm", int_t, 0, "Z offset in mm", 0, -200, 200)
gen.add("z_scaling", double_t, 0, "Scaling factor for depth values", 1.0, 0.5, 1.5)

gen.add("use_device_time", bool_t, 0, "Use internal timer of OpenNI device", True)

gen.add("keep_alive", bool_t, 0, "Send keep alive message to device", False)

exit(gen.generate(PACKAGE, "Astra", "Astra"))

